<!-- 客户列表  -->

<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">

<div th:replace="~{fragment/headFragment :: head}"></div>
<body class="cbp-spmenu-push">
<div class="main-content">
    <!--left-fixed -navigation-->

    <div th:replace="~{fragment/left-border :: left}"></div>

    <div th:replace="~{fragment/header :: header}"></div>

    <div id="page-wrapper">

        <div class="main-page">

            <div class="tables">

                <div class="bs-example widget-shadow" data-example-id="contextual-table">
                    <!--					<h4>Colored Rows Table:</h4>-->
<!--搜索   -->
                    <div class="search-box" style="margin-bottom:2em;" th:fragment="search-box">
                        <form class="input" action="/customerInfo/index" method="get">
                            <input class="sb-search-input input__field--madoka" placeholder="Search..." type="search" id="input-31" name="value" th:value="${#request.getParameter('value')}"/>
                            <label class="input__label" for="input-31">
                            <input type="text" name="current" value="1" style="display: none">
                            <input type="text" name="size" value="5" style="display: none">

                                <svg class="graphic" width="100%" height="100%" viewBox="0 0 404 77" preserveAspectRatio="none">
                                    <path d="m0,0l404,0l0,77l-404,0l0,-77z"/>
                                </svg>
                            </label>
                            <input type="submit" value="提交" style="display: none">
                        </form>
                    </div><!--//end-search-box-->


<!--                    新建用户-->
                    <div class="col-md-4 modal-grids" style="margin-top: 1.1em;margin-left: 3em;float: right;">
                        <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">
                            新建客户</button>
                        <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <form action="/customerInfo/insert" method="post">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                        <h4 class="modal-title" id="exampleModalLabel">新建客户</h4>
                                    </div>
                                    <div class="modal-body">
<!--                                        <form action="/customerInfo/insert" method="post">-->
                                        <div class="form-group">
                                            <label for="recipient-name" class="control-label">客户名*:</label>
                                            <input type="text" class="form-control" name="customername">
                                        </div>
                                        <div class="form-group">
                                            <label for="recipient-name" class="control-label">真实姓名:</label>
                                            <input type="text" class="form-control" name="realname">
                                        </div>
                                        <div class="form-group">
                                            <label for="recipient-name" class="control-label">联系电话:</label>
                                            <input type="text" class="form-control" name="phone">
                                        </div>
                                        <div class="form-group">
                                            <label for="recipient-name" class="control-label">邮箱:</label>
                                            <input type="text" class="form-control" name="email">
                                        </div>
                                        <div class="form-group">
                                            <label for="recipient-name" class="control-label">客户公司:</label>
                                            <input type="text" class="form-control" id="recipient-name" name="company">
                                        </div>
<!--                                        </form>-->
                                    </div>
                                    <div class="modal-footer">
<!--                                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>-->
<!--                                        <button type="button" class="btn btn-primary">Send message</button>-->
<!--                                        <input type="button" class="btn btn-default" data-dismiss="modal">Close</input>-->
                                        <input type="submit" class="btn btn-primary"></input>
                                    </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>


                    <table class="table">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>客户名称</th>
                            <th>真实姓名</th>
                            <th>邮箱</th>
                            <th>电话</th>
                            <th>等级</th>
                            <th>状态</th>
                            <th>最近登录时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="c,rowInfo : ${list}">
                            <th scope="row" th:text="${rowInfo.count}">1</th>
                            <th th:text="${c.getCustomername()}"></th>
                            <td th:text="${c.getRealname()}"></td>
                            <td th:text="${c.getEmail()}"></td>
                            <td th:text="${c.getPhone()}"></td>
                            <td th:text="${c.getLevel()}"></td>
                            <td th:text="${c.getState()}"></td>
                            <td th:text="${c.getLastedlogintime()}"></td>
                            <td>
                                <a th:href="@{/customerInfo/getOne(id=${c.id},state=-1,current=${#request.getParameter('current')})}">详情</a>
                                <a th:href="@{/customerInfo/update(id=${c.id},current=${#request.getParameter('current')},size=5)}">修改</a>
                                <a onClick="delcfm()" th:href="@{/customerInfo/del(id=${c.id},current=${#request.getParameter('current')},size=5)}">删除</a>
                                <a th:href="@{/customerInfo/addWorkOder(id=${c.id},current=${#request.getParameter('current')},size=5)}">创建工单</a>
                                <script language="javascript">
                                    function delcfm() {
                                        if (!confirm("确认要删除？")) {
                                            window.event.returnValue = false;
                                        }
                                    }
                                </script>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <ul class="pagination pagination-lg">
<!--                     th:class="${#request.getParameter('current')==i}"    -->
                        <li><a th:href="@{/customerInfo/index(value=${#request.getParameter('value')},current=${#request.getParameter('current')}-1,size=5)}" aria-label="Previous"><span aria-hidden="true">«</span></a></li>
                        <li th:classappend="${(#request.getParameter('current') eq #strings.concat(i))?'active':''}" th:each="i:${#numbers.sequence(1,pagesCount)}"><a th:href="@{/customerInfo/index(value=${#request.getParameter('value')},current=${i},size=5)}" th:text="${i}"></a></li>
                        <li><a th:href="@{/customerInfo/index(value=${#request.getParameter('value')},current=${#request.getParameter('current')}+1,size=5)}" aria-label="Next"><span aria-hidden="true">»</span></a></li>
                    </ul>
                </div>

            </div>
        </div>
    </div>
</div>
<!-- Classie -->
<script src="js/classie.js"></script>
<script>
    var menuLeft = document.getElementById( 'cbp-spmenu-s1' ),
        showLeftPush = document.getElementById( 'showLeftPush' ),
        body = document.body;

    showLeftPush.onclick = function() {
        classie.toggle( this, 'active' );
        classie.toggle( body, 'cbp-spmenu-push-toright' );
        classie.toggle( menuLeft, 'cbp-spmenu-open' );
        disableOther( 'showLeftPush' );
    };

    function disableOther( button ) {
        if( button !== 'showLeftPush' ) {
            classie.toggle( showLeftPush, 'disabled' );
        }
    }
</script>
<!--scrolling js-->
<script src="js/jquery.nicescroll.js"></script>
<script src="js/scripts.js"></script>
<!--//scrolling js-->
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.js"> </script>
</body>
</html>